<?php foreach($task['Comment'] as $comment) : ?>
<div class="task-item">
	<div><i><?php echo $comment['User']['username']; ?> post to <?php echo $comment['created']; ?></i></div>
	<div><?php echo $comment['text']; ?></div>
	<?php echo $this->element('attach_files', array('media' => $comment['Media'])); ?>
</div>
<?php endforeach; ?>
<?php if($task['Task']['status'] != 'closed' && $current_user['User']['role'] != 'spectator') : ?>
<div class="task-item">
	<?php echo $form->create('Comment', array('url' => '/comments/add', 'type' => 'file')); ?>
	<?php echo $form->input('task_id', array('type' => 'hidden', 'value' => $task['Task']['id'])); ?>
	<?php echo $form->input('text', array('label' => false, 'style' => 'max-width: 99%; min-width: 99%;')); ?>
	<div class="files">
		<div class="file"><?php echo $form->file('Files.file', array('name' => 'data[Files][]')); ?></div>
	</div>
	<div id="attach-another-file" style="margin: 0 0 0 4px;">
		<a href="#attach-another-file">Attach another file</a>
	</div>
	<?php echo $form->end('Submit'); ?>
</div>
<?php endif; ?>